package com.example.demo.mall.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.mall.entity.Cart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CartMapper extends BaseMapper<Cart> {
    // 获取用户购物车（带商品选中状态）
    List<Cart> selectByUserIdWithSelected(@Param("userId") Long userId);

    // 批量删除购物车商品
    int deleteBatch(@Param("userId") Long userId, @Param("productIds") List<Long> productIds);
}
